package com.changgou.test.reflection;

import java.lang.reflect.Field;

public class test1 {

    private user1 user1;
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        user1 user1 = new user1();
        Class c1 = Class.forName("com.changgou.test.reflection.user1");
        Class c2 = Class.forName("com.changgou.test.reflection.user1");
        Class c3 = Class.forName("com.changgou.test.reflection.user1");

        System.out.println(c1.hashCode());
        System.out.println(c2.hashCode());
        System.out.println(c3.hashCode());
        user1 =  (user1) c1.newInstance();

     //   final Field declaredField = c1.getDeclaredField("", "");

        Field fe[] = user1.getClass().getFields();
        for(Field f : fe){
            System.out.println(f);
        }
    }
}


class user1 {

    private  String name = "as";

    private String getName() {
        return name;
    }

    private void setName(String name) {
        this.name = name;
    }
}